

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>The logging module &mdash; pyamp v1.2 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '1.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="pyamp v1.2 documentation" href="index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li><a href="index.html">pyamp v1.2 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pyamp.logging">
<span id="the-logging-module"></span><h1>The logging module<a class="headerlink" href="#module-pyamp.logging" title="Permalink to this headline">¶</a></h1>
<p>The logging module contains a series of modules which aim to improve
the ease of debugging a system through logging messages to a given stream.</p>
<p>The <a class="reference internal" href="_generated/pyamp_logging_logger.html#pyamp.logging.logger.Logger" title="pyamp.logging.logger.Logger"><tt class="xref py py-class docutils literal"><span class="pre">pyamp.logging.logger.Logger</span></tt></a> class is the central class to the
logging module. It is essentially a wrapper class for the Python <a class="reference external" href="http://docs.python.org/library/logging.html#logging" title="(in Python v2.7)"><tt class="docutils literal"><span class="pre">logging</span></tt></a>
module and provides extended functionality such as: adding prefixes to the
logged messages, and logging colored messages to the console.</p>
<div class="section" id="the-loglevel-class">
<h2>The LogLevel class<a class="headerlink" href="#the-loglevel-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.LogLevel">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">LogLevel</tt><a class="headerlink" href="#pyamp.logging.LogLevel" title="Permalink to this definition">¶</a></dt>
<dd><p>The LogLevel class contains definitions of all of the various log
levels that can be used for logging messages. These levels are designed
to make it easier to parse the output of a system to find different types
of issues that were encountered at runtime.</p>
<ul class="simple">
<li><strong>DEBUG</strong> &#8211; The debugging log level. Has a value of 10.</li>
<li><strong>INFO</strong> &#8211; The information log level. Has a value of 20.</li>
<li><strong>WARN</strong> &#8211; The warning log level. Has a value of 30.</li>
<li><strong>WARNING</strong> &#8211; The warning log level. Has a value of 30.</li>
<li><strong>ERROR</strong> &#8211; The error log level. Has a value of 40.</li>
<li><strong>CRITICAL</strong> &#8211; The critical log level. Has a value of 50.</li>
<li><strong>FATAL</strong> &#8211; The fatal log level. Has a value of 50.</li>
</ul>
</dd></dl>

</div>
<div class="section" id="the-logdata-class">
<h2>The LogData class<a class="headerlink" href="#the-logdata-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.LogData">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">LogData</tt><big>(</big><em>logLevel=20</em>, <em>debugLevel=0</em>, <em>prefix=&lt;pyamp.logging.prefix.Prefix instance at 0x957a32c&gt;</em><big>)</big><a class="headerlink" href="#pyamp.logging.LogData" title="Permalink to this definition">¶</a></dt>
<dd><p>The LogData class provides the ability to store logging data for an
entire system in an object that can be easily handled.</p>
<p>The LogData class stores a <a class="reference internal" href="#pyamp.logging.LogLevel" title="pyamp.logging.LogLevel"><tt class="xref py py-class docutils literal"><span class="pre">LogLevel</span></tt></a> and an integer debug level
for a system, and provides the ability to create a named <a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a>
from the stored values.</p>
<p>For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># Any Logger objects created from this LogData object will have a</span>
<span class="c"># LogLevel of DEBUG, and a debug level of 10.</span>
<span class="n">logData</span> <span class="o">=</span> <span class="n">LogData</span><span class="p">(</span><span class="n">LogLevel</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>

<span class="c"># Create a logger named &#39;ExampleLogger&#39; which will log messages</span>
<span class="c"># with a red foreground color.</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">logData</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;ExampleLogger&quot;</span><span class="p">,</span> <span class="n">Colors</span><span class="o">.</span><span class="n">Foreground</span><span class="o">.</span><span class="n">Red</span><span class="p">)</span>

<span class="c"># This message will be displayed</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Example message&quot;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>

<span class="c"># This message will not be displayed</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Example message&quot;</span><span class="p">,</span> <span class="mi">11</span><span class="p">)</span>
</pre></div>
</div>
<p>LogData objects can be easily passed around which allows the
:class::<cite>LogLevel</cite> and debug level values to be easily propagated
throughout the system, rather than having individual values for each
system component.</p>
<ul class="simple">
<li>logLevel &#8211; The log level</li>
<li>debugLevel &#8211; The debug level</li>
<li>prefix &#8211; The prefix chain to use for all loggers</li>
</ul>
<dl class="method">
<dt id="pyamp.logging.LogData.get">
<tt class="descname">get</tt><big>(</big><em>name=None</em>, <em>color=0</em><big>)</big><a class="headerlink" href="#pyamp.logging.LogData.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a new Logger with the given name.</p>
<ul class="simple">
<li>name &#8211; The name to assign the Logger</li>
<li>color &#8211; The color to use for the Logger</li>
</ul>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-logger-class">
<h2>The Logger class<a class="headerlink" href="#the-logger-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.Logger">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">Logger</tt><big>(</big><em>name=None</em>, <em>color=0</em>, <em>prefix=&lt;pyamp.logging.prefix.Prefix instance at 0x957d32c&gt;</em>, <em>logLevel=30</em>, <em>debugLevel=0</em>, <em>handler=&lt;logging.StreamHandler instance at 0x957af2c&gt;</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger" title="Permalink to this definition">¶</a></dt>
<dd><p>The Logger class provides the ability to log various types
of messages to a specific stream, and formats the messages using given
<a class="reference internal" href="#pyamp.logging.Prefix" title="pyamp.logging.Prefix"><tt class="xref py py-class docutils literal"><span class="pre">Prefix</span></tt></a> objects.</p>
<p>The Logger class will log each <a class="reference internal" href="#pyamp.logging.LogLevel" title="pyamp.logging.LogLevel"><tt class="xref py py-class docutils literal"><span class="pre">LogLevel</span></tt></a> with a colored
prefix indicating the name of the log level. Logged messages are only
displayed in the event that the <a class="reference internal" href="#pyamp.logging.LogLevel" title="pyamp.logging.LogLevel"><tt class="xref py py-class docutils literal"><span class="pre">LogLevel</span></tt></a> at which they are
logged is greater than or equal to the current <a class="reference internal" href="#pyamp.logging.LogLevel" title="pyamp.logging.LogLevel"><tt class="xref py py-class docutils literal"><span class="pre">LogLevel</span></tt></a> of the
Logger which is logging the message. Each <tt class="xref py py-class docutils literal"><span class="pre">LogLevel.DEBUG</span></tt>
message can also have an optional debug level specified, which will allow
that message to be displayed so long as the specified debug level is less
than or equal to the configured debug level of the Logger object.</p>
<p>Each Logger object can be named, and colored, which means that
any message logged using that object will be displayed with a prefix
indicating the name (and displayed in the specified color) of the object
which logged the message.</p>
<p>Logger objects can be given a chain of <a class="reference internal" href="#pyamp.logging.Prefix" title="pyamp.logging.Prefix"><tt class="xref py py-class docutils literal"><span class="pre">Prefix</span></tt></a> objects.
Any message logged using that Logger object will then have a
series of prefixes added to the front of the message.</p>
<p>Logger objects can also have a handler specified, which specifies
the type of stream which will be handled by this Logger. For
example, to output to the console a value of <a class="reference external" href="http://docs.python.org/library/logging.handlers.html#logging.StreamHandler" title="(in Python v2.7)"><tt class="docutils literal"><span class="pre">logging.StreamHandler</span></tt></a>
could be specified, whereas a value of <a class="reference external" href="http://docs.python.org/library/logging.handlers.html#logging.FileHandler" title="(in Python v2.7)"><tt class="docutils literal"><span class="pre">logging.FileHandler</span></tt></a> could
be specified to log to a specific file.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># Create a Logger with the name &#39;Example1&#39;</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">Logger</span><span class="p">(</span><span class="s">&quot;Example1&quot;</span><span class="p">)</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Information message&quot;</span><span class="p">)</span>

<span class="c"># Create a Logger with the name &#39;Example2&#39;, a foreground</span>
<span class="c"># color of Blue, and logs DEBUG messages that have a debug</span>
<span class="c"># level less than or equal to 10.</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">Logger</span><span class="p">(</span><span class="s">&quot;Example2&quot;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">Colors</span><span class="o">.</span><span class="n">Foreground</span><span class="o">.</span><span class="n">Blue</span><span class="p">,</span>
                <span class="n">logLevel</span><span class="o">=</span><span class="n">LogLevel</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span> <span class="n">debugLevel</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;This message is displayed&quot;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;This message is not displayed&quot;</span><span class="p">,</span> <span class="mi">11</span><span class="p">)</span>

<span class="c"># Create a Logger with the name &#39;Example3&#39; that only displays</span>
<span class="c"># ERROR messages</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">Logger</span><span class="p">(</span><span class="s">&quot;Example3&quot;</span><span class="p">,</span> <span class="n">logLevel</span><span class="o">=</span><span class="n">LogLevel</span><span class="o">.</span><span class="n">ERROR</span><span class="p">)</span>
<span class="n">logger</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;This would not be displayed&quot;</span><span class="p">)</span>
</pre></div>
</div>
<ul class="simple">
<li>name &#8211; The name of the Logger</li>
<li>color &#8211; The color to use for this Logger</li>
<li>prefix &#8211; The <a class="reference internal" href="#pyamp.logging.Prefix" title="pyamp.logging.Prefix"><tt class="xref py py-class docutils literal"><span class="pre">Prefix</span></tt></a> chain to use for this Logger</li>
<li>logLevel &#8211; The log level to use for this Logger</li>
<li>debugLevel &#8211; The debug level</li>
<li>handler &#8211; The handler to use for this Logger</li>
</ul>
<dl class="method">
<dt id="pyamp.logging.Logger.critical">
<tt class="descname">critical</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.critical" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a critical message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.debug">
<tt class="descname">debug</tt><big>(</big><em>message</em>, <em>level=0</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.debug" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a debug message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>level &#8211; The debug level</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.error">
<tt class="descname">error</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.error" title="Permalink to this definition">¶</a></dt>
<dd><p>Log an error message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.fatal">
<tt class="descname">fatal</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.fatal" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a fatal message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.info">
<tt class="descname">info</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.info" title="Permalink to this definition">¶</a></dt>
<dd><p>Log an info message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.log">
<tt class="descname">log</tt><big>(</big><em>logLevel</em>, <em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.log" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a message at the given log level.</p>
<ul class="simple">
<li>logLevel &#8211; The level at which to log</li>
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.setName">
<tt class="descname">setName</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.setName" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the name for this logger.</p>
<ul class="simple">
<li>name &#8211; The name</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.setPrefix">
<tt class="descname">setPrefix</tt><big>(</big><em>prefix</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.setPrefix" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the prefix for this logger.</p>
<ul class="simple">
<li>prefix &#8211; The prefix</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.warn">
<tt class="descname">warn</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.warn" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a warning message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Logger.warning">
<tt class="descname">warning</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Logger.warning" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a warning message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-singlelogger-class">
<h2>The SingleLogger class<a class="headerlink" href="#the-singlelogger-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.SingleLogger">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">SingleLogger</tt><a class="headerlink" href="#pyamp.logging.SingleLogger" title="Permalink to this definition">¶</a></dt>
<dd><p>The SingleLogger class implements the <a class="reference internal" href="patterns.html#pyamp.patterns.Borg" title="pyamp.patterns.Borg"><tt class="xref py py-class docutils literal"><span class="pre">pyamp.patterns.Borg</span></tt></a>
design pattern for creating a single system wide <a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a> object.</p>
<p>This allows an entire system to access the same <a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a> object so
that each component can log messages with the same data (e.g., log level,
color, prefix, etc).</p>
<p>Create the SingleLogger object.</p>
<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.createFileLogger">
<em class="property">classmethod </em><tt class="descname">createFileLogger</tt><big>(</big><em>logFile</em>, <em>append=False</em>, <em>logLevel=30</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.createFileLogger" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a system-wide <tt class="xref py py-class docutils literal"><span class="pre">FileLogger</span></tt> object.</p>
<ul class="simple">
<li>logFile &#8211; The log file to use</li>
<li>append &#8211; True to append to the file, False to overwrite</li>
<li>logLevel &#8211; The log level for the logger</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.createLogger">
<em class="property">classmethod </em><tt class="descname">createLogger</tt><big>(</big><em>name</em>, <em>logLevel=30</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.createLogger" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a system-wide <a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a> object.</p>
<ul class="simple">
<li>name &#8211; The name of Logger</li>
<li>logLevel &#8211; The log level for the logger</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.critical">
<em class="property">classmethod </em><tt class="descname">critical</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.critical" title="Permalink to this definition">¶</a></dt>
<dd><p>Log the given critical message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.debug">
<em class="property">classmethod </em><tt class="descname">debug</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.debug" title="Permalink to this definition">¶</a></dt>
<dd><p>Log the given debug message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.error">
<em class="property">classmethod </em><tt class="descname">error</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.error" title="Permalink to this definition">¶</a></dt>
<dd><p>Log the given error message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.fatal">
<em class="property">classmethod </em><tt class="descname">fatal</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.fatal" title="Permalink to this definition">¶</a></dt>
<dd><p>Log the given fatal message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.getInstance">
<em class="property">classmethod </em><tt class="descname">getInstance</tt><big>(</big><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.getInstance" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the instance of the <a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a> object.</p>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.info">
<em class="property">classmethod </em><tt class="descname">info</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.info" title="Permalink to this definition">¶</a></dt>
<dd><p>Log the given information message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.log">
<em class="property">classmethod </em><tt class="descname">log</tt><big>(</big><em>logLevel</em>, <em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.log" title="Permalink to this definition">¶</a></dt>
<dd><p>Log the given message at the given log level.</p>
<ul class="simple">
<li>logLevel &#8211; The log level</li>
<li>message &#8211; The message to log</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.warn">
<em class="property">classmethod </em><tt class="descname">warn</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.warn" title="Permalink to this definition">¶</a></dt>
<dd><p>Log the given warning message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.warning">
<em class="property">classmethod </em><tt class="descname">warning</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.warning" title="Permalink to this definition">¶</a></dt>
<dd><p>Log the given warning message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
</ul>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.logging.SingleLogger.write">
<em class="property">classmethod </em><tt class="descname">write</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#pyamp.logging.SingleLogger.write" title="Permalink to this definition">¶</a></dt>
<dd><p>Write an information message to the logger.</p>
<ul class="simple">
<li>message &#8211; The message to write</li>
</ul>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-colors-class">
<h2>The Colors class<a class="headerlink" href="#the-colors-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.Colors">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">Colors</tt><a class="headerlink" href="#pyamp.logging.Colors" title="Permalink to this definition">¶</a></dt>
<dd><p>The Colors class contains two classes which define possible Foreground
and Background colors. These colors can be used to colorize console output
in a specific way.</p>
<dl class="class">
<dt id="pyamp.logging.Colors.Background">
<em class="property">class </em><tt class="descname">Background</tt><a class="headerlink" href="#pyamp.logging.Colors.Background" title="Permalink to this definition">¶</a></dt>
<dd><p>The Background class contains definitions of the following
background colors.</p>
<ul class="simple">
<li><em>White_Bold_Underline</em></li>
<li><em>Blue</em>, and <em>Light_Blue</em></li>
<li><em>Purple</em>, and <em>Light_Purple</em></li>
<li><em>Green</em>, and <em>Light_Green</em></li>
<li><em>Red</em>, and <em>Light_Red</em></li>
<li><em>Gray</em>, and <em>Light_Gray</em></li>
<li><em>Cyan</em>, and <em>Light_Cyan</em></li>
<li><em>Orange</em>, and <em>Light_Yellow</em></li>
</ul>
</dd></dl>

<dl class="class">
<dt id="pyamp.logging.Colors.Foreground">
<em class="property">class </em><tt class="descclassname">Colors.</tt><tt class="descname">Foreground</tt><a class="headerlink" href="#pyamp.logging.Colors.Foreground" title="Permalink to this definition">¶</a></dt>
<dd><p>The Foreground class contains definitions of the following
foreground colors.</p>
<ul class="simple">
<li><em>White</em></li>
<li><em>White_Bold</em></li>
<li><em>White_Underline</em></li>
<li><em>Black</em></li>
<li><em>Blue</em>, and <em>Light_Blue</em></li>
<li><em>Purple</em>, and <em>Light_Purple</em></li>
<li><em>Green</em>, and <em>Light_Green</em></li>
<li><em>Red</em>, and <em>Light_Red</em></li>
<li><em>Gray</em>, and <em>Light_Gray</em></li>
<li><em>Cyan</em>, and <em>Light_Cyan</em></li>
<li><em>Orange</em>, and <em>Light_Yellow</em></li>
</ul>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-prefix-class">
<h2>The Prefix class<a class="headerlink" href="#the-prefix-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.Prefix">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">Prefix</tt><big>(</big><em>text=None</em>, <em>color=0</em>, <em>prefix=None</em><big>)</big><a class="headerlink" href="#pyamp.logging.Prefix" title="Permalink to this definition">¶</a></dt>
<dd><p>The Prefix class provides the ability to add chain of prefixes to a
message. A Prefix contains text which is printed in square brackets
before the given message. The following shows an example of the a
Prefix for the string &#8220;DEBUG&#8221;.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">prefix</span> <span class="o">=</span> <span class="n">Prefix</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="s">&quot;DEBUG&quot;</span><span class="p">)</span>

<span class="c"># Prints: [DEBUG]: This is the message</span>
<span class="n">prefix</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span><span class="s">&quot;This is the message&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>A Prefix can be colored, and it can contain other prefixes which are
appended to the message before adding the current Prefix.</p>
<p>An example of multiple prefixes:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">debugPrefix</span> <span class="o">=</span> <span class="n">Prefix</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="s">&quot;DEBUG&quot;</span><span class="p">)</span>
<span class="n">examplePrefix</span> <span class="o">=</span> <span class="n">Prefix</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="s">&quot;example&quot;</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="n">debugPrefix</span><span class="p">)</span>
<span class="n">datePrefix</span> <span class="o">=</span> <span class="n">Prefix</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="s">&quot;03/11/2012&quot;</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="n">examplePrefix</span><span class="p">)</span>

<span class="c"># Prints: [DEBUG]: [example]: [03/11/2012]: This is the message</span>
<span class="n">datePrefix</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span><span class="s">&quot;This is the message&quot;</span><span class="p">)</span>
</pre></div>
</div>
<ul class="simple">
<li>text &#8211; The text to display in the Prefix</li>
<li>color &#8211; The color in which the Prefix will be displayed</li>
<li>prefix &#8211; The next Prefix in the chain</li>
</ul>
<dl class="method">
<dt id="pyamp.logging.Prefix.apply">
<tt class="descname">apply</tt><big>(</big><em>message</em>, <em>useColors=False</em><big>)</big><a class="headerlink" href="#pyamp.logging.Prefix.apply" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply the chain of Prefixes to the given message.</p>
<ul class="simple">
<li>message &#8211; The message to apply the Prefix chain to</li>
<li>useColors &#8211; True to use colors, False otherwise</li>
</ul>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-fnprefix-class">
<h2>The FnPrefix class<a class="headerlink" href="#the-fnprefix-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.FnPrefix">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">FnPrefix</tt><big>(</big><em>function</em>, <em>color=0</em>, <em>prefix=None</em><big>)</big><a class="headerlink" href="#pyamp.logging.FnPrefix" title="Permalink to this definition">¶</a></dt>
<dd><p>The FnPrefix class provides to ability to create a <a class="reference internal" href="#pyamp.logging.Prefix" title="pyamp.logging.Prefix"><tt class="xref py py-class docutils literal"><span class="pre">Prefix</span></tt></a> whose
text results from calling a specified function when the <a class="reference internal" href="#pyamp.logging.Prefix" title="pyamp.logging.Prefix"><tt class="xref py py-class docutils literal"><span class="pre">Prefix</span></tt></a> is
applied to a message.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">prefix</span> <span class="o">=</span> <span class="n">FnPrefix</span><span class="p">(</span><span class="n">function</span><span class="o">=</span><span class="k">lambda</span><span class="p">:</span> <span class="s">&quot;Hey!&quot;</span><span class="p">)</span>

<span class="c"># Prints: [Hey!]: This is the message</span>
<span class="n">prefix</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span><span class="s">&quot;This is the message&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>This class can be used to dynamically create the text used for a prefix by
calling a function which returns the desired value for the prefix.</p>
<ul class="simple">
<li>function &#8211; The function which returns the Prefix text</li>
<li>color &#8211; The color in which the Prefix will be displayed</li>
<li>prefix &#8211; The next Prefix in the chain</li>
</ul>
</dd></dl>

</div>
<div class="section" id="the-timeprefix-class">
<h2>The TimePrefix class<a class="headerlink" href="#the-timeprefix-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.TimePrefix">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">TimePrefix</tt><big>(</big><em>format=None</em>, <em>color=0</em>, <em>prefix=None</em><big>)</big><a class="headerlink" href="#pyamp.logging.TimePrefix" title="Permalink to this definition">¶</a></dt>
<dd><p>The TimePrefix provides the ability to add a <a class="reference internal" href="#pyamp.logging.Prefix" title="pyamp.logging.Prefix"><tt class="xref py py-class docutils literal"><span class="pre">Prefix</span></tt></a> which
displays the date and or time when the <a class="reference internal" href="#pyamp.logging.Prefix" title="pyamp.logging.Prefix"><tt class="xref py py-class docutils literal"><span class="pre">Prefix</span></tt></a> is applied to the
message in a specified format.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">prefix</span> <span class="o">=</span> <span class="n">TimePrefix</span><span class="p">(</span><span class="n">format</span><span class="o">=</span><span class="s">&quot;%Y-%m-</span><span class="si">%d</span><span class="s">&quot;</span><span class="p">)</span>

<span class="c"># Prints: [2012-03-22]: This is the message</span>
<span class="n">prefix</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span><span class="s">&quot;This is the message&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>This class is useful for dynamically timestamping logged messages so they
can easily be tracked in the system output.</p>
<ul>
<li><dl class="first docutils">
<dt>format &#8211; The format in which the time will be displayed. See the</dt>
<dd><p class="first last">man page for &#8216;date&#8217;</p>
</dd>
</dl>
</li>
<li><p class="first">color &#8211; The color in which the Prefix will be displayed</p>
</li>
<li><p class="first">prefix &#8211; The next prefix in the chain</p>
</li>
</ul>
</dd></dl>

</div>
<div class="section" id="the-loggable-class">
<h2>The Loggable class<a class="headerlink" href="#the-loggable-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.Loggable">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">Loggable</tt><big>(</big><em>name=None</em>, <em>logger=None</em>, <em>color=0</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable" title="Permalink to this definition">¶</a></dt>
<dd><p>The Loggable class provides the ability to expose the logging methods
(i.e., debug, info, warn, warning, error, fatal, critical, and error) on
a specific class. This provides the ability to easily log messages
throughout a class without needed to specifically create a <a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a>
object.</p>
<p>The Loggable class can be created from either a <a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a> object, or
a <a class="reference internal" href="#pyamp.logging.LogData" title="pyamp.logging.LogData"><tt class="xref py py-class docutils literal"><span class="pre">LogData</span></tt></a> object.</p>
<ul class="simple">
<li>name &#8211; The name of the Logger</li>
<li>logger &#8211; The LogData, or Logger object to use</li>
<li>color &#8211; The color of the Logger</li>
</ul>
<dl class="method">
<dt id="pyamp.logging.Loggable.critical">
<tt class="descname">critical</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable.critical" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a critical message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Loggable.debug">
<tt class="descname">debug</tt><big>(</big><em>message</em>, <em>level=0</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable.debug" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a debug message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>level &#8211; The debug level</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Loggable.error">
<tt class="descname">error</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable.error" title="Permalink to this definition">¶</a></dt>
<dd><p>Log an error message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Loggable.fatal">
<tt class="descname">fatal</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable.fatal" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a fatal message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Loggable.info">
<tt class="descname">info</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable.info" title="Permalink to this definition">¶</a></dt>
<dd><p>Log an info message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Loggable.log">
<tt class="descname">log</tt><big>(</big><em>logLevel</em>, <em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable.log" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a message at the given log level.</p>
<ul class="simple">
<li>logLevel &#8211; The level at which to log</li>
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Loggable.warn">
<tt class="descname">warn</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable.warn" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a warning message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.logging.Loggable.warning">
<tt class="descname">warning</tt><big>(</big><em>message</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pyamp.logging.Loggable.warning" title="Permalink to this definition">¶</a></dt>
<dd><p>Log a warning message.</p>
<ul class="simple">
<li>message &#8211; The message to log</li>
<li>args &#8211; The arguments</li>
<li>kwargs &#8211; The keyword arguments</li>
</ul>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-loggermeta-class">
<h2>The LoggerMeta class<a class="headerlink" href="#the-loggermeta-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.LoggerMeta">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">LoggerMeta</tt><a class="headerlink" href="#pyamp.logging.LoggerMeta" title="Permalink to this definition">¶</a></dt>
<dd><p>The LoggerMeta is a metaclass that provides the ability to create a
<a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a> for a given class. The class has the ability to set the
following static class properties.</p>
<ul class="simple">
<li><em>logLevel</em> &#8211; Set log level for the logger</li>
<li><em>logPrefix</em> &#8211; Set the log prefix for the logger</li>
</ul>
<p>Any classes that use LoggerMeta as their metaclass will have a &#8216;logger&#8217;
property created, which will be a <a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a> object with the preset
logLevel, and logPrefix.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Example</span><span class="p">:</span>
    <span class="n">__metaclass__</span> <span class="o">=</span> <span class="n">LoggerMeta</span>
    <span class="n">logLevel</span> <span class="o">=</span> <span class="n">LogLevel</span><span class="o">.</span><span class="n">INFO</span>
    <span class="n">logPrefix</span> <span class="o">=</span> <span class="n">Prefix</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="s">&quot;TestPrefix&quot;</span><span class="p">)</span>

<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span>
    <span class="n">example</span> <span class="o">=</span> <span class="n">Example</span><span class="p">()</span>

    <span class="c"># Prints: [Example]: [TestPrefix]: This is an information message</span>
    <span class="n">example</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;This is an information message&quot;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="the-functionloggermeta-class">
<h2>The FunctionLoggerMeta class<a class="headerlink" href="#the-functionloggermeta-class" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyamp.logging.FunctionLoggerMeta">
<em class="property">class </em><tt class="descclassname">pyamp.logging.</tt><tt class="descname">FunctionLoggerMeta</tt><a class="headerlink" href="#pyamp.logging.FunctionLoggerMeta" title="Permalink to this definition">¶</a></dt>
<dd><p>The FunctionLoggerMeta class is a metaclass that provides the ability
to log specific functions of a class. This metaclass uses the
<a class="reference internal" href="#pyamp.logging.Logger" title="pyamp.logging.Logger"><tt class="xref py py-class docutils literal"><span class="pre">Logger</span></tt></a> object (as created by the <a class="reference internal" href="#pyamp.logging.LoggerMeta" title="pyamp.logging.LoggerMeta"><tt class="xref py py-class docutils literal"><span class="pre">LoggerMeta</span></tt></a> class) to
print debug statements as functions of a class are entered and exited.</p>
<dl class="docutils">
<dt>The following types of functions will NOT be logged:</dt>
<dd><ul class="first last simple">
<li>Builtin functions (i.e., the function name ends with &#8216;__&#8217;)</li>
<li>Functions that are decorated with the <a class="reference internal" href="#pyamp.logging.doNotLog" title="pyamp.logging.doNotLog"><tt class="xref py py-func docutils literal"><span class="pre">doNotLog()</span></tt></a> function</li>
</ul>
</dd>
</dl>
<p>All other functions will log a DEBUG message when the function is entered
and when the function is exited. This provides an easy way to toggle the
ability to view the scope of functions during the runtime of a system.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Example</span><span class="p">:</span>
    <span class="n">__metaclass__</span> <span class="o">=</span> <span class="n">FunctionLoggerMeta</span>

    <span class="k">def</span> <span class="nf">test</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">print</span> <span class="s">&quot;This is a test&quot;</span>


<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span>
    <span class="n">example</span> <span class="o">=</span> <span class="n">Example</span><span class="p">()</span>

    <span class="c"># Prints:</span>
    <span class="c">#    [DEBUG]: Entering test</span>
    <span class="c">#    This is a test</span>
    <span class="c">#    [DEBUG]: Exiting test</span>
    <span class="n">example</span><span class="o">.</span><span class="n">test</span><span class="p">()</span>
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="the-donotlog-function-decorator">
<h2>The doNotLog function decorator<a class="headerlink" href="#the-donotlog-function-decorator" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="pyamp.logging.doNotLog">
<tt class="descclassname">pyamp.logging.</tt><tt class="descname">doNotLog</tt><big>(</big><em>function</em><big>)</big><a class="headerlink" href="#pyamp.logging.doNotLog" title="Permalink to this definition">¶</a></dt>
<dd><p>The doNotLog function is a decorator function which flags a function
so that it does not get logged by the <a class="reference internal" href="#pyamp.logging.FunctionLoggerMeta" title="pyamp.logging.FunctionLoggerMeta"><tt class="xref py py-class docutils literal"><span class="pre">FunctionLoggerMeta</span></tt></a> class.</p>
<p>Any functions decorated with &#8216;doNotLog&#8217; will be ignored by the
<a class="reference internal" href="#pyamp.logging.FunctionLoggerMeta" title="pyamp.logging.FunctionLoggerMeta"><tt class="xref py py-class docutils literal"><span class="pre">FunctionLoggerMeta</span></tt></a> class.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Example</span><span class="p">:</span>
    <span class="n">__metaclass__</span> <span class="o">=</span> <span class="n">FunctionLoggerMeta</span>

    <span class="c"># This function will be logged</span>
    <span class="k">def</span> <span class="nf">logged</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">pass</span>

    <span class="c"># This function will not be logged</span>
    <span class="nd">@doNotLog</span>
    <span class="k">def</span> <span class="nf">notLogged</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">pass</span>
</pre></div>
</div>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">The logging module</a><ul>
<li><a class="reference internal" href="#the-loglevel-class">The LogLevel class</a></li>
<li><a class="reference internal" href="#the-logdata-class">The LogData class</a></li>
<li><a class="reference internal" href="#the-logger-class">The Logger class</a></li>
<li><a class="reference internal" href="#the-singlelogger-class">The SingleLogger class</a></li>
<li><a class="reference internal" href="#the-colors-class">The Colors class</a></li>
<li><a class="reference internal" href="#the-prefix-class">The Prefix class</a></li>
<li><a class="reference internal" href="#the-fnprefix-class">The FnPrefix class</a></li>
<li><a class="reference internal" href="#the-timeprefix-class">The TimePrefix class</a></li>
<li><a class="reference internal" href="#the-loggable-class">The Loggable class</a></li>
<li><a class="reference internal" href="#the-loggermeta-class">The LoggerMeta class</a></li>
<li><a class="reference internal" href="#the-functionloggermeta-class">The FunctionLoggerMeta class</a></li>
<li><a class="reference internal" href="#the-donotlog-function-decorator">The doNotLog function decorator</a></li>
</ul>
</li>
</ul>

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/logging.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li><a href="index.html">pyamp v1.2 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, Brett Ponsler.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
    </div>
  </body>
</html>